home *** CD-ROM | disk | FTP | other *** search
/ Isometric Game Programming with DirectX 7.0 / Isometric Game Programming.iso / source / chapter21 / isohex21_1 / isomousemap.h < prev    next >
C/C++ Source or Header  |  2000-07-24  |  1KB  |  71 lines

  1. //IsoMouseMap.h
  2. #ifndef __ISOMOUSEMAP_H__
  3. #define __ISOMOUSEMAP_H__
  4.  
  5. #include <windows.h>
  6. #include "IsoTilePlotter.h"
  7. #include "IsoTileWalker.h"
  8. #include "IsoScroller.h"
  9.  
  10. //mousemap directions
  11. typedef enum {
  12.     MM_CENTER=0,
  13.     MM_NW=1,
  14.     MM_NE=2,
  15.     MM_SW=3,
  16.     MM_SE=4
  17. } MOUSEMAPDIRECTION;
  18.  
  19. //mousemap class
  20. class CMouseMap
  21. {
  22. private:
  23.     //width and height of lookup
  24.     int iWidth;
  25.     int iHeight;
  26.  
  27.     //reference point(adjustment for the upper left of tile 0,0)
  28.     POINT ptRef;
  29.  
  30.     //lookup table
  31.     MOUSEMAPDIRECTION* mmdLookUp;
  32.  
  33.     //scroller
  34.     CScroller* pScroller;
  35.     
  36.     //walker
  37.     CTileWalker* pTileWalker;
  38. public:
  39.     //constructor
  40.     CMouseMap();
  41.     //destructor
  42.     ~CMouseMap();
  43.  
  44.     //load mousemap
  45.     void Load(LPCTSTR lpszFileName);//used with iso and hex maps
  46.     void Create(int iWidth,int iHeight);//used with rectangular maps
  47.     //destroy mousemap
  48.     void Destroy();
  49.  
  50.     //width/height
  51.     int GetWidth();
  52.     int GetHeight();
  53.  
  54.     //reference
  55.     POINT* GetReferencePoint();
  56.     void SetReferencePoint(POINT* pptRefPt);
  57.     void CalcReferencePoint(CTilePlotter* pTilePlotter,RECT* prcExtent);
  58.  
  59.     //map the mouse
  60.     POINT MapMouse(POINT ptMouse);
  61.  
  62.     //scroller
  63.     CScroller* GetScroller();
  64.     void SetScroller(CScroller* pScroller);
  65.  
  66.     //walker
  67.     CTileWalker* GetTileWalker();
  68.     void SetTileWalker(CTileWalker* pTileWalker);
  69. };
  70.  
  71. #endif